//-----------------------------------------------------------------------
// <copyright file="MembershipFeeService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class MembershipFeeService
    {
        #region MembershipFee

        public static void CreateMembershipFee(MembershipFee membershipFee)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                membershipFeeDAO.CreateMembershipFee(membershipFee);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateMembershipFeeException, ex);
            }
        }        

        public static void UpdateMembershipFee(MembershipFee membershipFee)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                membershipFeeDAO.UpdateMembershipFee(membershipFee);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateMembershipFeeException, ex);
            }
        }        

        public static void DeleteMembershipFee(int membershipFeeID)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                membershipFeeDAO.DeleteMembershipFee(membershipFeeID);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteMembershipFeeException, ex);
            }
        }
        
        public static MembershipFee GetMembershipFee(int membershipFeeID)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                return membershipFeeDAO.GetMembershipFee(membershipFeeID);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetMembershipFeeException, ex);
            }
        }                

        public static MembershipFeeCollection GetMembershipFeeList(MembershipFeeColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                return membershipFeeDAO.GetMembershipFeeList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetMembershipFeeListException, ex);
            }
        }        

        public static MembershipFeeCollection GetMembershipFeeList(MembershipFeeColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                return membershipFeeDAO.GetMembershipFeeList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetMembershipFeeListException, ex);
            }
        }        

	    public static MembershipFeeCollection GetMembershipFeeListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                return membershipFeeDAO.GetMembershipFeeListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetMembershipFeeListException, ex);
            }
        }        

        public static MembershipFeeCollection GetMembershipFeeListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                MembershipFeeDAO membershipFeeDAO = new MembershipFeeDAO();
                return membershipFeeDAO.GetMembershipFeeListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetMembershipFeeListException, ex);
            }
        }        

        #endregion
    }
}